package Framework.IntroScreens  
{
	import flash.events.DataEvent;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.events.Event;
	import Framework.BaseGui;
	import Framework.GuiElements.Button;
	/**
	 * ...
	 * @author Menno
	 */
	public class TextScreen extends BaseGui
	{
		private var _textLoader:URLLoader;
		private var _texts:Array;
		private var _buttons:Array;
		
		public function TextScreen(urlString:String) 
		{
			_buttons = new Array();
			_texts = new Array();
			_textLoader = new URLLoader();
			_textLoader.addEventListener(Event.COMPLETE, readText);
			
			_textLoader.load(new URLRequest(urlString));
		}
		
		protected function readText(e:Event):void 
		{
			texts = e.target.data.split(/;/);
			displayText();
		}
		
		protected function displayText():void 
		{
			
		}
		
		public function get texts():Array 
		{
			return _texts;
		}
		
		public function set texts(value:Array):void 
		{
			_texts = value;
		}
		
		public function addButton(name:String,x:int, y:int, width:int, height:int):Button
		{
			var button:Button = new Button(name, x, y, width, height);		
			_buttons.push(button);
			
			return button;
		}
		
	}
	
}